package com.mall.service.impl;

import com.mall.dao.ICartDao;
import com.mall.domain.Cart;
import com.mall.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("cartService")
public class CartServiceImp implements ICartService {
    @Autowired
    private ICartDao iCartDao;

    //第一次加入购物车
    @Override
    public void addCart(Cart cart) {
        iCartDao.addCart(cart);
    }

    //多次加入购物车/修改购物车商品数量
    @Override
    public void addCartNum(Cart cart) {
        iCartDao.addCartNum(cart);
    }

    //删除购物车商品
    @Override
    public void deleteCartGoods(Cart cart) {
        iCartDao.deleteCartGoods(cart);
    }

    @Override
    public void deleteCartGoods1(Cart cart) {
        iCartDao.deleteCartGoods1(cart);
    }

    //展示购物车商品
    @Override
    public List<Cart> showCart() {
        return iCartDao.showCart();
    }
}
